<template>
  <div class="tabbar">
    <router-link
      v-for="nav in navs"
      :key='nav.path'
      :to='nav.path'
      tag='div'
    >
      <i class="iconfont" v-html="nav.meta.icon"></i>
      <span>{{nav.meta.title}}</span>
    </router-link>
    <!-- <router-link to='/' tag="div">
        <i class="iconfont">&#xe88c;</i>
        <span>首页</span>
    </router-link>
    <router-link to='/category' tag="div">
        <i class="iconfont">&#xe86c;</i>
        <span>分类</span>
    </router-link>
    <router-link to='/cart' tag="div">
        <i class="iconfont">&#xe86e;</i>
        <span>购物车</span>
    </router-link>
    <router-link to='mine' tag="div">
        <i class="iconfont">&#xe882;</i>
        <span>我的</span>
    </router-link> -->
  </div>
</template>

<script>
import routes from '@/router/routes'
export default {
  name: 'Tabbar',
  computed: {
    navs () {
      return routes.filter(route => route.meta.isNav)
    }
  }
}
</script>

<style lang="scss" scoped>
.tabbar{
  display: flex;
  height: 40px;
  div{
      flex: 1;
      text-align: center;
      display: flex;
      flex-direction: column;
      justify-content: center;
  }
  .router-link-exact-active, .router-link-active{
      background-color: #eeeeee;
  }
}
</style>
